
import { _decorator, Component, Node, director, sys } from 'cc';
import { LoadSceneProgressBar } from './LoadScene';
import { SoltaireGame } from './SoltaireGame';
import GameManager from './tool/GameManager';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = SolitaireLoaLoding
 *
 */
 
@ccclass('SolitaireLoading')
export class SolitaireLoading extends Component {
    
    onLoad()
    {
    }
    
    start () {
        // [3]

        GameManager.Instance.adaptation();
        if (GameManager.Instance.GetScreenOrientation()==1) {
            //director.loadScene("gameH");
            //LoadScene.instance.OpenScene("gameH");
            director.preloadScene("gameH");
        }else
        {
            //director.loadScene("gameW");
            //LoadScene.instance.OpenScene("gameW");
            director.preloadScene("gameW");
        }
    }

    ClickPlay(event: Event, customEventData: number)
    {
        GameManager.Instance.difficult=customEventData;
        if (GameManager.Instance.GetScreenOrientation()==1) {
            //director.loadScene("gameH");
            LoadSceneProgressBar.instance.OpenScene("gameH");
        }else
        {
            //director.loadScene("gameW");
            LoadSceneProgressBar.instance.OpenScene("gameW");
        }
    }
    ClickPrivacy()
    {
        //sys.openURL("https://sites.google.com/view/watermelon-bang-private-policy");
    }
}


